package xyz.zdsoft.attendance_manage_module.service.imp;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import xyz.zdsoft.attendance_manage_module.bo.AdminPunchRecordBo;
import xyz.zdsoft.attendance_manage_module.mapper.AdminPunchRecordMapper;
import xyz.zdsoft.attendance_manage_module.service.AdminPunchRecordService;
import xyz.zdsoft.attendance_manage_module.vo.AdminPunchRecordVo;
import xyz.zdsoft.project_group_manage_module.entity.MyDto.RespPageBean;

import javax.annotation.Resource;

@Service
public class AdminPunchRecordServiceImpl  implements AdminPunchRecordService {
    @Resource
    private AdminPunchRecordMapper adminAttendanceInfoBo;
    @Override
    public RespPageBean SelPunchRecord(Integer currentPage, Integer size, AdminPunchRecordBo adminPunchRecordBo) {
        //开启分页
        Page<AdminPunchRecordVo> page=new Page<>(currentPage,size);
        IPage<AdminPunchRecordVo> punchRecordPage=adminAttendanceInfoBo.SelPunchRecord(page,adminPunchRecordBo);
        return new RespPageBean(punchRecordPage.getTotal(),punchRecordPage.getRecords());
    }
}
